
/**
 *  Insert csv data in database
 */
function insert_csv_data(data)
{
	//console.log(data);
	$(".ajax-loader" ).show();

	var ajaxURL = AJAX_URL + '/insert_csv_data/';
	$(".ajax-loader" ).show();
//console.log(data);

	$.ajax({
		type: "POST",
   // dataType: 'json',
		url: ajaxURL,
		data : 'data=' + data,
		//async: false,
		success: function(response){
    console.log(response);
		/*
			var parsed = response.split('|');			
			
      if (typeof parsed[1] != 'undefined') {
         var report = "<p>" + parsed[1] + "</p>";
       } else {
         var report = '';
       }
			if(parsed[0] == 'true')
			{
				$("#response_insert")
				//.css('color', 'green')
				.addClass('ui-state-highlight ui-corner-all')
				.html(report);
			} else {
				$("#response_insert")
				//.css('color', 'red')
				.addClass('ui-state-error ui-corner-all')
				.html(report);
			}
			*/
			$(".ajax-loader" ).hide();
		} //end success
	}); //end ajax

}

